package com.huaxin.device.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.huaxin.hxenum.enums.EquipmentDataType;
import com.huaxin.hxenum.enums.Unit;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 采集设备与被采集对象的数据源关联表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("equipment_data_source")
@Schema(description = "数据源关联")
public class EquipmentDataSource extends BaseModel {

    @TableField(value = "collector_id")
    @Schema(description = "采集设备ID", example = "di123e456-789a-bcde-f012-3456789abcde")
    private String collectorId;

    @TableField(value = "equipment_id")
    @Schema(description = "被采集的电力设备ID", example = "eq123e456-789a-bcde-f012-3456789abcdf")
    private String equipmentId;

    @TableField(value = "room_id")
    @Schema(description = "被采集的配电房ID", example = "rm123e456-789a-bcde-f012-3456789abcde")
    private String roomId;

    @TableField(value = "cabinet_id")
    @Schema(description = "被采集的变电箱ID", example = "cb123e456-789a-bcde-f012-3456789abcdf")
    private String cabinetId;

    @TableField(value = "well_id")
    @Schema(description = "被采集的电井ID", example = "wl123e456-789a-bcde-f012-3456789abcde")
    private String wellId;

    @TableField(value = "data_type")
    @Schema(description = "数据类型：CURRENT, VOLTAGE, POWER 等", example = "CURRENT")
    private EquipmentDataType dataType;

    @TableField(value = "data_name")
    @Schema(description = "数据项名称", example = "A相电流")
    private String dataName;

    @TableField(value = "is_primary")
    @Schema(description = "是否为主展示数据：0-否，1-是", example = "1")
    private Boolean isPrimary;

    @TableField(value = "sort_order")
    @Schema(description = "排序号", example = "10")
    private Integer sortOrder;

    @TableField(value = "unit")
    @Schema(description = "单位", example = "A")
    private Unit unit;

    @TableField(value = "collection_interval")
    @Schema(description = "采集间隔（秒）", example = "30")
    private Integer collectionInterval;

    @TableField(value = "description")
    @Schema(description = "备注")
    private String description;

    @TableField(value = "family_id")
    @Schema(description = "所属家庭ID", example = "fa123e456-789a-bcde-f012-3456789abcde")
    private String familyId;
}